<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>学校报名咨询管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/js/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/admin/css/common.css" media="all">
    <script src="/js/layui/layui.all.js"></script>
    <script src="/admin/js/token.js"></script>
</head>
<style type="text/css">
    #textfield {
        border: 1px solid rgba(152, 166, 173, 0.15);
        font-size: 13px;
        height: 34px;
        padding-left: 20px;
        padding-right: 40px;
        margin: 13px 15px 0px 25px;
        background: rgba(152, 166, 173, 0.1);
        box-shadow: none;
        border-radius: 30px;
        width: 200px;
        cursor: text;
        float: left;
    }

    #shusearch {
        cursor: pointer;
        width: 30px;
        float: left;
        margin-top: 20px;
        margin-left: -40px;
    }


</style>
<body class="layui-layout-body">

<div id="LAY_app">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <!-- 头部区域 -->
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item layadmin-flexible" lay-unselect>
                    <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
                        <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
                    </a>
                </li>
                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:;" layadmin-event="refresh" title="刷新" id="sx">
                        <i class="layui-icon layui-icon-refresh-3"></i>
                    </a>
                </li>

                <li class="layui-nav-item" style="margin: auto">
                    <a href="#">
                    </a>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right" style="right: 40px;">

                <li class="layui-nav-item " lay-unselect><!--layui-hide-xs-->
                    <a href="javascript:;" layadmin-event="theme">
                        <i class="layui-icon layui-icon-theme"></i>
                    </a>
                </li>

                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="javascript:;" layadmin-event="fullscreen">
                        <i class="layui-icon layui-icon-screen-full"></i>
                    </a>
                </li>

                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:;" id="adminName"></a>
                    <dl class="layui-nav-child">
<!--                        <dd><a href="/" >切换用户</a></dd>-->
                        <dd><a href="javascript:void(0)" onclick="update_password()" >修改密码</a></dd>
                        <hr>
                        <dd style="text-align: center;"><a href="#" onclick="qiehuan()">退出</a></dd>
                    </dl>
                </li>

            </ul>
        </div>
        <!-- 侧边菜单 -->
        <div class="layui-side layui-side-menu">
            <div class="layui-side-scroll">
                <div class="layui-logo" style="background-color: #20222A !important;">
                    <span>学校报名咨询系统</span>
                </div>

                <ul class="layui-nav layui-nav-tree"  lay-filter="layadmin-system-side-menu" lay-shrink="all" id="LAY-system-side-menu">

<!--                    <li data-name="home" class="layui-nav-item layui-this" id="home" >-->
<!--                        <a  href="echart2.html" _lay-href="echart2.html" lay-tips="主页" target="mainframe" lay-direction="2">-->
<!--                            <i class="layui-icon layui-icon-home"></i>-->
<!--                            <cite>主页</cite>-->
<!--                        </a>-->
<!--                    </li>-->

                    <li data-name="system" class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;" lay-tips="客服管理" lay-direction="2">
                            <i class="layui-icon layui-icon-notice"></i>
                            <cite>网络接待</cite>
                        </a>
                        <dl class="layui-nav-child">
                            <dd data-name="nav" class="layui-this" style="position: relative;">
                                <a target="mainframe" href="chat/liuyanList2.html" class="clearStorage">查看网站留言</a>
                                <div id="unhandled" style="background-color: red;color: white;width: 16px;height: 16px;border-radius: 30px;position: absolute;right: 10px;top: 10px;text-align: center;line-height: 16px;font-size: 12px;">3</div>
                            </dd>
                        </dl>
                        <dl class="layui-nav-child">
                            <dd data-name="nav">
                                <a target="mainframe" href="chat/kefuchat.html" class="clearStorage">在线沟通</a>
                            </dd>
                        </dl>
                        <dl class="layui-nav-child">
                            <dd data-name="nav">
                                <a target="mainframe" href="chat/chathelp.html" class="clearStorage">帮助手册</a>
                            </dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>


        <div class="layadmin-pagetabs" id="LAY_app_tabs">
            <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
            <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
            <div class="layui-icon layadmin-tabs-control layui-icon-down">
                <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
                    <li class="layui-nav-item" lay-unselect>
                        <a href="javascript:;"></a>
                        <dl class="layui-nav-child layui-anim-fadein">
                            <dd layadmin-event="closeThisTabs"><a href="javascript:;" >关闭当前标签页</a></dd>
                            <dd layadmin-event="closeOtherTabs"><a href="javascript:;" >关闭其它标签页</a></dd>
                            <dd layadmin-event="closeAllTabs"><a href="javascript:;" >关闭全部标签页</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>

            <!--浏览记录条-->
            <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
                <ul class="layui-tab-title" id="LAY_app_tabsheader">
                    <li lay-id="staion/station.html" lay-attr="staion/station.html" class="layui-this">
                        <i class="layui-icon layui-icon-home"></i>
                    </li>
                </ul>
            </div>
        </div>

        <!-- 主体内容 -->
        <div class="layui-body" id="LAY_app_body">
            <div class="layadmin-tabsbody-item layui-show">
                <iframe name="mainframe" id="mainframe" src="chat/liuyanList2.html" frameborder="0" class="layadmin-iframe"></iframe>
            </div>
        </div>

        <!-- 辅助元素，一般用于移动设备下遮罩 -->
        <div class="layadmin-body-shade" layadmin-event="shade"></div>
    </div>
</div>

<script src="/js/layui/layui.js"></script>

<script>
    layui.config({
        base: 'viewstyle/' //主页样式的嵌入地址
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index'], function () {
        var $ = layui.$
            , admin = layui.admin
            , element = layui.element
            , router = layui.router();

        //解决刷新问题
        element.render();
        element.on('tab(layadmin-layout-tabs)', function (data) {
            setTimeout(function () {
                var e = document.createEvent("MouseEvents");
                e.initEvent("click", true, true);
                document.getElementById("sx").dispatchEvent(e);
            }, 20)
        });

        var active = {
            maintree1: function () {
                admin.popup({
                    title: 'yingfeituo'
                    , shade: 0
                    , anim: -1
                    , area: ['280px', '150px']
                    , id: 'layadmin-layer-skin-test'
                })
            }
            , maintree2: function () {
                top.layui.admin.popupRight({
                    id: 'LAY_adminPopupLayerTest'
                    , success: function () {
                        $('#' + this.id).html('<div class="layui-form-item">' +
                            '<div class="layui-inline ">' +
                            '<input  type="text" id="textfield" placeholder="搜索用户" class="layui-input">' +
                            '<span  id="shusearch" onclick="shusearch()" class="layui-icon layui-icon-search"></span>' +
                            '</div>' +
                            '</div><div id="maintree1" class="demo-tree demo-tree-box"></div>');
                        $("#maintree1").load("/admin/shumoxing/ztree.html");
                    }
                });
            },
        };

        $('.shuxing').on('click', function () {
            var type = $(this).data('type');
            active[type] && active[type].call(this);
        });
    });

    function update_password(){
        var kefuid = sessionStorage.getItem("kefu_id");
        $("#mainframe").attr("src" , "/admin/user/Updatepassword.html?t=2");
    }

    //退出登录
    function qiehuan() {
        $.ajax({
            url:'/kefu/quitLogin',
            datatype:'json',
            type:'get',
            success:function (result) {
                if (result.code==200){
                    localStorage.removeItem("kefu_id")
                    window.location = '/admin/index.html';
                }else{
                    result = JSON.parse(result)
                    layer.msg(result.msg,{icon:2,time:1000});
                }
            }
        })
    }
</script>

<script>
    function goLogin(btnLogin) {
        if (btnLogin.innerHTML=='未登录')
        {
            top.location = '/';
        }
    }

    function denglu(){
        $.ajax({
            url: "/kefu/pandeng_kefu",
            success: function (res) {
                if(res.code==0){
                    $("#adminName").html(res.data);
                }else {
                    $("#adminName").html("请先登录");
                    top.location = '/admin/index.html';
                }
            }
        })
        $.ajax({
            url: "/zixun/getunhandled",
            success: function (res) {
                if(res.code==200){
                    $("#unhandled").html(res.data);
                }
            }
        })
    }
    denglu();
    window.setInterval(denglu,10000);

    // 返回按钮事件
    $(".layui-icon-prev").click(function(){
        history.back(); // 后退一次
    });
    $(".layui-icon-next").click(function(){
        history.forward();// 前进一次
    });

</script>
</body>
</html>


